package com.zg.shop.adminuser;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

public class AdminUserDao extends HibernateDaoSupport{

	public AdminUser login(AdminUser adminUser) {
		
		
		System.out.println(adminUser.getUsername() + "===" + adminUser.getPassword());
		List<AdminUser> adminUsers = this.getHibernateTemplate().find("from AdminUser where username=? and password=?", adminUser.getUsername(), adminUser.getPassword());
		System.out.println("============1============");
		if(adminUsers.size() > 0){
			System.out.println("============2============");
			return adminUsers.get(0);			
		}else{
			System.out.println("============12============");
			return null;			
		}
	}

}
